package rm1;

import java.net.DatagramSocket;
import java.net.SocketException;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import Servants.MyServiceServerImpl;
import Servants.UDPServer;
import Servants.UDP_Replica1_Lisener;

public class RMHoldBack
{	
	public static void main(String [] argu)
	{

		MyServiceServerImpl montreal = new MyServiceServerImpl("montreal");
		UDPServer MontrealUDP = new UDPServer(montreal);
		MontrealUDP.start();

		MyServiceServerImpl toronto = new MyServiceServerImpl("toronto");
		UDPServer TorontoUDP = new UDPServer(toronto);
		TorontoUDP.start();

		MyServiceServerImpl vancouver = new MyServiceServerImpl("vancouver");
		UDPServer VancouverUDP = new UDPServer(vancouver);
		VancouverUDP.start();
		
		
		UDPManagerListener rm1Manager = null;
		try {
			 rm1Manager = new UDPManagerListener(new DatagramSocket(61100), montreal, toronto, vancouver);
		} catch (SocketException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}
		
		rm1Manager.start();
		
		
		ReliableUDPListener rm1 = null;
		
		try {
			rm1 = new ReliableUDPListener(new DatagramSocket(61000),montreal,vancouver,toronto);
		} catch (SocketException e) {

			e.printStackTrace();
		}

		rm1.run();

	}
}
